package com.csaba.connector.fhb.model;

public class FHBRequestFactory
{
	public final static String URL_INIT = "https://www.ib.fhb.hu/bfo.channel.web/bfo/channel/web/loginframe.jsp?locale=HU";
	public final static String URL_BASE = "https://www.ib.fhb.hu/bfo.channel.web";

	public final static String ACTION_LOGIN_PAGE = "bfo/channel/web/function/login/login.jsp";
	public final static String ACTION_LOGIN_PROCESS = "bfo/channel/web/function/login/loginprocess.jsp";
	public final static String ACTION_SELECT_GROUP = "bfo/channel/web/function/selectgroup/selectgroup.jsp";
	public final static String ACTION_CHECK_MULTICUSTOMER = "bfo/channel/web/function/selectgroup/checkifmulticustomeruser.jsp";
	public final static String ACTION_WELCOME = "bfo/channel/web/function/welcome/welcome.jsp";
	public final static String ACTION_LOGOUT_PROCESS = "bfo/channel/web/function/logout/logoutprocess.jsp";
	public final static String ACTION_DUMMY = "bfo/channel/web/dummy/dummy.jsp";

	public final static String TYPE_LOGIN_PROCESS = "UnencodedLoginRequest";
	public final static String TYPE_SELECT_GROUP = "bfo.channel.web.function.login";
	public final static String TYPE_CHECK_MULTICUSTOMER = "bfo.channel.web.function.selectgroup";

	private static FHBRequestFactory instance;

	public static FHBRequestFactory getInstance()
	{
		if ( instance == null )
			instance = new FHBRequestFactory();

		return instance;
	}

	private String lastUrl = "bfo/channel/web/loginframe.jsp";

	public String getAction( final String action, final String requestType )
	{
		final String lastUrl = this.lastUrl;
		this.lastUrl = action;
		return URL_BASE + "/dispatcher?_T_=/" + action + "&_S_=" + lastUrl + "&_F_=" + requestType;
	}
}
